/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Services;

import Services.exception.ServiceException;
import Services.exception.UnableToConnectException;
import beans.ProviderProductBean;
import database.daos.ProviderProductDAO;


/**
 *
 * @author Anthar
 */
public class ProviderProductServices {

        private ProviderProductDAO providerProdDAO;

        public ProviderProductServices(){
            providerProdDAO = new ProviderProductDAO();
        }

        public ProviderProductBean searchProviderProduct(int idProduct, int idProvider) throws ServiceException{
        try {
            return getProviderProdDAO().searchProviderProduct(idProduct, idProvider);
        } catch (database.daos.DAOException ex) {
            throw new UnableToConnectException(ex.getExceptionMessage());
        }
          
        }

    /**
     * @return the providerProdDAO
     */
    public ProviderProductDAO getProviderProdDAO() {
        return providerProdDAO;
    }

    /**
     * @param providerProdDAO the providerProdDAO to set
     */
    public void setProviderProdDAO(ProviderProductDAO providerProdDAO) {
        this.providerProdDAO = providerProdDAO;
    }


}
